PROJECT(XPMDOC-Gui)


FIND_PACKAGE(Qt4 REQUIRED)
#find xerces package
INCLUDE(${QT_USE_FILE})

#add the files to our groups and app
SOURCE_GROUP("textedit" ./textedit/*)
SOURCE_GROUP("mapedit" ./mapedit/*)
SOURCE_GROUP("sdftree" ./sdftree/*)
SOURCE_GROUP("viewmodel" ./viewmodel/*)
#seems to be a bug in cmake, can't put these in analysis\\standard folder :(
#upper detail

#QT4_WRAP_CPP
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})

QT4_WRAP_CPP(textedit_MOCS ./textedit/textedit.h)
QT4_WRAP_CPP(XpmTextEdit_MOCS ./viewmodel/XpmTextEdit.h)
QT4_WRAP_CPP(XpmCompleter_MOCS ./viewmodel/XpmCompleter.h)
#text edit
QT4_WRAP_CPP(TableInsert_MOCS ./textedit/TableInsert.h)
QT4_ADD_RESOURCES(textedit_SRCS ./textedit/textedit.qrc)
QT4_WRAP_UI(TableInsert_UIS ./textedit/TableInsert.ui)
#xpmschema
#QT4_WRAP_CPP(xpmschema_MOCS ./textedit/xpmschema.h)
#xpm
#QT4_WRAP_CPP(xpm_MOCS ./textedit/xpm.h)
#map edit
QT4_WRAP_CPP(mapeditor_MOCS ./mapedit/mapeditor.h)
QT4_WRAP_CPP(addmap_MOCS ./mapedit/addmap.h)
QT4_WRAP_CPP(removemap_MOCS ./mapedit/removemap.h)
QT4_WRAP_CPP(XpmDocModel_MOCS ./mapedit/XpmDocModel.h)
QT4_WRAP_CPP(XpmLineEdit_MOCS ./mapedit/XpmLineEdit.h)
QT4_ADD_RESOURCES(mapeditor_SRCS ./mapedit/mapeditor.qrc)
QT4_WRAP_UI(mapeditor_UIS ./mapedit/mapeditor.ui)
QT4_WRAP_UI(mapeditor_UIS ./mapedit/addmap.ui)
QT4_WRAP_UI(mapeditor_UIS ./mapedit/removemap.ui)
#sdftree
QT4_WRAP_UI(sdftree_UIS ./sdftree/sdftree.ui)
QT4_WRAP_CPP(sdftree_MOCS ./sdftree/sdftree.h)
#QT4_WARP_UI

SET(XPMDOC-Gui_Files
	#for example 
	#./control/ControlSynset.cpp	
#	./textedit/main.cc	
	./textedit/textedit.cc	
#	./textedit/xpmschema.cc
#	./textedit/xpm.cc
	./textedit/TableInsert.cc
	./mapedit/mapeditor.cc
	./mapedit/addmap.cc
	./mapedit/removemap.cc
	./mapedit/XpmDocModel.cc
	./mapedit/TreeItem.cc
	./mapedit/BlockTreeItem.cc
	./mapedit/TermTreeItem.cc
	./mapedit/XpmLineEdit.cc
	./sdftree/sdftree.cc
	./viewmodel/XpmTextEdit.cc
	./viewmodel/XpmCompleter.cc
	./viewmodel/SignTreeModel.cc
	${textedit_MOCS}
#	${xpmschema_MOCS}
#	${xpm_MOCS}
	${TableInsert_MOCS}
	${mapeditor_MOCS}
	${XpmTextEdit_MOCS}
	${XpmCompleter_MOCS}
	${XpmDocModel_MOCS}
	${addmap_MOCS}
	${removemap_MOCS}
	${sdftree_MOCS}
	${XpmLineEdit_MOCS}
	${TableInsert_UIS}
	${mapeditor_UIS}
	${addmap_UIS}
	${removemap_UIS}
	${sdftree_UIS}
	${textedit_SRCS}	
	${mapeditor_SRCS}	
)


#find our headers
file(GLOB_RECURSE HEADERS ${XPMDOC-Gui_SOURCE_DIR}/*.h)



#create the libraries
INCLUDE_DIRECTORIES( ${XPMDOC_SOURCE_DIR}/src/gui 
                     ${XPMDOC_SOURCE_DIR}/src/model
					 ${XPMDOC_SOURCE_DIR}/src/control
					 ${XPMDOC_SOURCE_DIR}/src/dal
					 )			 


add_library(XPMDOC-Gui
	           ${XPMDOC-Gui_Files} 
	           ${HEADERS})

#FIND_PACKAGE(XERCESC REQUIRED)

#TARGET_LINK_LIBRARIES(XPMDOC-Gui 
#                      XPMDOC-Model 
#                      XPMDOC-Control	
#                      XPMDOC-Dal					  
#					  ${QT_LIBRARIES}
#					  ${XERCESC_LIBRARY})
#					  
#TARGET_LINK_LIBRARIES(XPMDOC-Gui
#               optimized
#               D:/Projects/conex-google-2/conex/build/bin/Release/CONEX-Model.lib
#               D:/Projects/conex-google-2/conex/build/bin/Release/CONEX-Control.lib
#			   D:/Projects/conex-google-2/conex/build/bin/Release/CONEX-Dal.lib
#			   D:/Projects/conex-google-2/conex/build/bin/Release/CONEX-Util.lib
#			   D:/Projects/libs/libjson-master/bin/release/libjson.lib)
#			   
#TARGET_LINK_LIBRARIES(XPMDOC-Gui
#               debug
#               D:/Projects/conex-google-2/conex/build/bin/Debug/CONEX-Modeld.lib
#               D:/Projects/conex-google-2/conex/build/bin/Debug/CONEX-Controld.lib
#			   D:/Projects/conex-google-2/conex/build/bin/Debug/CONEX-Dald.lib
#			   D:/Projects/conex-google-2/conex/build/bin/Debug/CONEX-Utild.lib
#			   D:/Projects/libs/libjson-master/bin/release/libjson.lib)

#set properties on the libraries
#SET_TARGET_PROPERTIES(XPMDOC-Gui PROPERTIES
#    VERSION ${XPMDOC_VERSION}
#    SOVERSION ${XPMDOC_SOVERSION}
#    COMPILE_DEFINITIONS_DEBUG _DEBUG
#)


#if(CMAKE_SYSTEM_NAME MATCHES "Windows")
#    if(DEFINED MINGW)
#		SET(CMAKE_EXE_LINKER_FLAGS "-mwindows -fopenmp")
#	else(DEFINED MINGW)
#	    SET_TARGET_PROPERTIES( XPMDOC-Gui PROPERTIES COMPILE_FLAGS "${XPMDOC_SOURCE_DIR}/src/dal/dal/db/otlv4.h" )
#        SET_TARGET_PROPERTIES( XPMDOC-Gui PROPERTIES LINK_FLAGS "odbc32.lib" )
#		SET(CMAKE_CXX_FLAGS "/DGLUT_BUILDING_LIB /openmp")
#		SET(CMAKE_EXE_LINKER_FLAGS "/subsystem:windows /entry:mainCRTStartup")
#	endif(DEFINED MINGW)
#else(CMAKE_SYSTEM_NAME MATCHES "Windows")
#	SET(CMAKE_EXE_LINKER_FLAGS "-fopenmp")
#endif(CMAKE_SYSTEM_NAME MATCHES "Windows")



